<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>固定技巧</title>
    <style>
        .w {
            width: 800px;
            height: 1400px;
            background-color: aqua;
            margin: 0 auto;
        }
        .fixed {
            position: fixed;
            /* 1.走浏览器宽度的一半 */
            left: 50%;
            /* 利用margin走版心盒子的一半 */
            margin-left: 405px;
            width: 50px;
            height: 150px;
            background-color: bisque;
        }
    </style>
</head>
<body>
    <div class="fixed"></div>
    <div class="w"><img src="img/固定小技巧.png" alt=""></div>
    

</body>
</html>